package com.my.code.pool;

import java.time.Duration;
import java.time.Instant;
import java.util.stream.LongStream;

public class TestAcc {
    public static void main(String[] args) {
        //构造一个亿的数组
        long[] numbs = LongStream.rangeClosed(0, 100000000).toArray();

        Instant start = Instant.now();

        Accumulation acc = new ForJoinAcc();
        long result = acc.acc(numbs);

        Instant end = Instant.now();
        long time = Duration.between(start, end).toMillis();
        System.out.println("耗时： " + time + "ms");
        System.out.println("result = " + result);
    }
}
